## Do-file  
## "Party Systems, Democratic Positions, and Regime Changes: 
## Introducing the Party-System Democracy Index" 


## First step: Run file "psdi_computation.R" to create the PSDI value
## Second step: Run lines 18-23 on file "psdi_validation_main.R" to merge PSDI with V-Dem variables
## Second+ step (needed for replication): upload all external datasets used in the validation and empirical tests 
## Third step: Run file "psdi_validation_main.R" to reproduce all main figures 
## Fourth step: Run lines 23-227 on file "psdi_replication_ddl_and_empirics.R" to merge PSDI and V-Dem variables with ERT variables and have the full set of variables for empirical models 
## Fifth step: Run file "psdi_replication_ddl_and_empirics.R" to reproduce also the tables in main text
## Sixth step: Run file "psdi_appendix.R" to reproduce all figures and tables presented in the online supplementary material


## NOTE: it is necessary to run steps 1, 2, and 4 to be able to run the following empirics. Step 2+ is needed for empirical sections too.

## Any further queries should be addressed to Fabio Angiolillo at fabio.angiolillo@gu.se